package lec13dp2;

import java.util.Arrays;

public class PrimerTest {
    final static int N = 100;
    static boolean dp[] = new boolean[N + 1];


    static {
        Arrays.fill(dp, true);
        dp[0] = dp[1] = false;
        //O(n)~O(nlgn)
        for (int i = 2; i * i <= N; i++) {
            if (dp[i]) {
                for (int j = 2 * i; j <= N; j += i) {//j>i  j%i==0
                    dp[j] = false;

                }
            }
        }
    }


    public static void main(String[] args) {
        for (int i = 0; i <= N; i++) {
            if (dp[i]) {
                System.out.print(i + " ");
            }
        }
    }


}
